﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                    xmlns:system="clr-namespace:System;assembly=mscorlib" 
                    mc:Ignorable="d">

	<!-- *********************************  RESOURCES  ********************************* -->
	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="Styles.SL.xaml" />
	</ResourceDictionary.MergedDictionaries>

	<!-- *********************************  BRUSHES  ********************************* -->
	<!--  TabControl Brushes -->
	<SolidColorBrush x:Key="TabControlBackgroundBrush" Color="{StaticResource Color_009}" />
	<SolidColorBrush x:Key="TabControlBorderBrush" Color="{StaticResource Color_004}" />
	<SolidColorBrush x:Key="TabItemBackgroundBrush" Color="{StaticResource Color_024}" />
	<SolidColorBrush x:Key="TabItemBorderBrush" Color="{StaticResource Color_004}" />
	<SolidColorBrush x:Key="TabItemHoverBackgroundBrush" Color="{StaticResource Color_006}" />
	<SolidColorBrush x:Key="TabItemSelectedBackgroundBrush" Color="{StaticResource Color_009}" />
	<SolidColorBrush x:Key="TabItemSelectedBorderBrush" Color="{StaticResource Color_004}" />
	<SolidColorBrush x:Key="TabItemFocusedBorderBrush" Color="{StaticResource Color_024}" />
    <SolidColorBrush x:Key="TabItemTexForegroundBrush" Color="{StaticResource Color_009}" Opacity="0.7" />
    <SolidColorBrush x:Key="TabItemTexSelectedForegroundBrush" Color="{StaticResource Color_024}" />

    <!--  GridSplitter Brushes -->
	<SolidColorBrush x:Key="GridSplitterBackgroundBrush" Color="{StaticResource Color_008}" />
	<SolidColorBrush x:Key="GridSplitterBorderBrush" Color="{StaticResource Color_004}" />
	<SolidColorBrush x:Key="GridSplitterHoverBackgroundBrush" Color="{StaticResource Color_006}" />
	<SolidColorBrush x:Key="GridSplitterHoverBorderBrush" Color="{StaticResource Color_003}" />
	<SolidColorBrush x:Key="GridSplitterPressedBackgroundBrush" Color="{StaticResource Color_024}" />
	<SolidColorBrush x:Key="GridSplitterFocusedBorderBrush" Color="{StaticResource Color_024}" />

	<!-- *********************************  Label Style  ********************************* -->
	<Style x:Key="LabelStyle" TargetType="sdk:Label">
		<Setter Property="FontFamily" Value="Segoe UI" />
		<Setter Property="FontSize" Value="13.333" />
		<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" />
		<Setter Property="HorizontalContentAlignment" Value="Left" />
		<Setter Property="IsTabStop" Value="False" />
	</Style>

	<!-- ********************************** TabControl Style **********************************-->
	<Style x:Key="TabControlStyle" TargetType="sdk:TabControl">
		<Setter Property="Background" Value="{StaticResource TabControlBackgroundBrush}" />
		<Setter Property="BorderBrush" Value="{StaticResource TabControlBorderBrush}" />
		<Setter Property="Padding" Value="0" />
		<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="VerticalContentAlignment" Value="Stretch" />
		<Setter Property="IsTabStop" Value="False" />
	</Style>

	<!-- ********************************** TabItem Style **********************************-->
	<Style x:Key="TabItemStyle" TargetType="sdk:TabItem">
		<Setter Property="FontSize" Value="14.667" />
		<Setter Property="FontFamily" Value="Segoe UI" />
		<Setter Property="Background" Value="{StaticResource TabItemBackgroundBrush}" />
		<Setter Property="BorderBrush" Value="{StaticResource TabItemBorderBrush}" />
		<Setter Property="BorderThickness" Value="1" />
		<Setter Property="Padding" Value="10,2" />
		<Setter Property="MinWidth" Value="5" />
		<Setter Property="MinHeight" Value="5" />
		<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="VerticalContentAlignment" Value="Stretch" />
		<Setter Property="IsTabStop" Value="False" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="sdk:TabItem">
					<Grid x:Name="Root">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualStateGroup.Transitions>
									<VisualTransition GeneratedDuration="0" />
									<VisualTransition To="MouseOver" GeneratedDuration="0:0:0.1" />
								</VisualStateGroup.Transitions>
								<VisualState x:Name="Normal" />
								<VisualState x:Name="MouseOver">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderTopUnselected" Storyboard.TargetProperty="Foreground">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource LightForegroundBrush}" />
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderTop" Storyboard.TargetProperty="Background">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}" />
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderTopUnselected" Storyboard.TargetProperty="Foreground">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ForegroundBrush}" />
										</ObjectAnimationUsingKeyFrames>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualTopSelected" Storyboard.TargetProperty="(UIElement.Opacity)">
											<SplineDoubleKeyFrame KeyTime="0" Value="1" />
										</DoubleAnimationUsingKeyFrames>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualTopUnSelected" Storyboard.TargetProperty="(UIElement.Opacity)">
											<SplineDoubleKeyFrame KeyTime="0" Value="1" />
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="SelectionStates">
								<VisualState x:Name="Unselected" />
								<VisualState x:Name="Selected">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualTop" Storyboard.TargetProperty="Visibility" Duration="0">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="FocusStates">
								<VisualState x:Name="Focused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualTop" Storyboard.TargetProperty="Visibility" Duration="0">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Unfocused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility" Duration="0">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>

						<!-- TabStripPlacement Top | Selected -->
						<Grid x:Name="TemplateTopSelected" Visibility="Collapsed" Canvas.ZIndex="1">
							<Border BorderBrush="{StaticResource AccordionButtonExpandedBorderBrush}" BorderThickness="1,1,1,0" Background="{StaticResource TabItemSelectedBackgroundBrush}" Margin="-2,-2,-2,0">
								<Grid>
                                    <ContentControl x:Name="HeaderTopSelected" MinHeight="26" IsTabStop="False" Foreground="{StaticResource TabItemTexSelectedForegroundBrush}" FontSize="{TemplateBinding FontSize}" HorizontalAlignment="Center" Margin="{TemplateBinding Padding}" Cursor="{TemplateBinding Cursor}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
								</Grid>
							</Border>
							<Border x:Name="FocusVisualTop" BorderBrush="{StaticResource TabItemFocusedBorderBrush}" BorderThickness="1,1,1,0" Margin="-2,-2,-2,0" Visibility="Collapsed" IsHitTestVisible="false" />
							<Border Margin="-2,-2,-2,0" x:Name="DisabledVisualTopSelected" IsHitTestVisible="false" Opacity="0" Background="{StaticResource DisabledVisualElement}" />
						</Grid>
						<!-- TabStripPlacement Top | Unselected -->
						<Grid x:Name="TemplateTopUnselected" Visibility="Collapsed">
							<Border x:Name="BorderTop" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{TemplateBinding Background}">
								<Grid>
									<Border x:Name="BorderTopHover" Margin="-1 " BorderThickness="1" Background="{StaticResource TabItemHoverBackgroundBrush}" Visibility="Collapsed" />
									<Border x:Name="GradientTop">
										<Grid>
                                            <ContentControl x:Name="HeaderTopUnselected" MinHeight="26" IsTabStop="False" Foreground="{StaticResource TabItemTexForegroundBrush}" FontSize="{TemplateBinding FontSize}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="{TemplateBinding Padding}" Cursor="{TemplateBinding Cursor}" />
										</Grid>
									</Border>
								</Grid>
							</Border>
							<Border x:Name="DisabledVisualTopUnSelected" IsHitTestVisible="false" Opacity="0" Background="{StaticResource DisabledVisualElement}" />
						</Grid>
						<Border x:Name="FocusVisualElement" BorderBrush="{StaticResource TabItemFocusedBorderBrush}" BorderThickness="2" Margin="-1" Visibility="Collapsed" IsHitTestVisible="false" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- ********************************** GridSplitter Style **********************************-->
	<Style x:Key="GridSplitterStyle" TargetType="sdk:GridSplitter">
		<Setter Property="Background" Value="{StaticResource GridSplitterBackgroundBrush}" />
		<Setter Property="BorderBrush" Value="{StaticResource GridSplitterBorderBrush}" />
		<Setter Property="BorderThickness" Value="1" />
		<Setter Property="HorizontalAlignment" Value="Right" />
		<Setter Property="IsTabStop" Value="true" />
		<Setter Property="PreviewStyle">
			<Setter.Value>
				<Style TargetType="Control">
					<Setter Property="Background" Value="{StaticResource GridSplitterPressedBackgroundBrush}" />
					<Setter Property="Template">
						<Setter.Value>
							<ControlTemplate TargetType="Control">
								<Grid x:Name="Root" Opacity="0.9">
									<Rectangle Fill="{TemplateBinding Background}" />
									<Grid x:Name="HorizontalTemplate" Height="6" />
									<Grid x:Name="VerticalTemplate" Visibility="Collapsed" Width="6" />
								</Grid>
							</ControlTemplate>
						</Setter.Value>
					</Setter>
				</Style>
			</Setter.Value>
		</Setter>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="sdk:GridSplitter">
					<Grid x:Name="Root" IsHitTestVisible="{TemplateBinding IsEnabled}">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal" />
								<VisualState x:Name="MouseOver">
									<Storyboard>
										<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="hoverRect" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root" />
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="FocusStates">
								<VisualState x:Name="Unfocused" />
								<VisualState x:Name="Focused">
									<Storyboard>
										<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisual" />
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" />
						<Rectangle x:Name="hoverRect" Fill="{StaticResource GridSplitterHoverBackgroundBrush}" Stroke="{StaticResource GridSplitterHoverBorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" Opacity="0" />
						<Grid x:Name="HorizontalTemplate" Height="10">
							<StackPanel Height="6" VerticalAlignment="Center">
								<Rectangle Fill="{StaticResource GlyphBackgroundBrush}" Height="1" Margin="1" StrokeThickness="0" Width="20" />
								<Rectangle Fill="{StaticResource GlyphBackgroundBrush}" Height="1" Margin="1" StrokeThickness="0" Width="20" />
							</StackPanel>
						</Grid>
						<Grid x:Name="VerticalTemplate" Visibility="Collapsed" Width="10">
							<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Width="6">
								<Rectangle Fill="{StaticResource GlyphBackgroundBrush}" Height="20" Margin="1" StrokeThickness="0" Width="1" />
								<Rectangle Fill="{StaticResource GlyphBackgroundBrush}" Height="20" Margin="1" StrokeThickness="0" Width="1" />
							</StackPanel>
						</Grid>
						<Rectangle x:Name="FocusVisual" IsHitTestVisible="false" Opacity="0" Stroke="{StaticResource GridSplitterFocusedBorderBrush}" StrokeThickness="1" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- *********************************  AutoCompleteBox Style  ********************************* -->
	<Style x:Key="AutoCompleteBoxStyle" TargetType="sdk:AutoCompleteBox">
		<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" />
		<Setter Property="Background" Value="{StaticResource LightForegroundBrush}" />
		<Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
		<Setter Property="BorderThickness" Value="1" />
		<Setter Property="Padding" Value="6,4" />
		<Setter Property="MinHeight" Value="30" />
		<Setter Property="MinWidth" Value="90" />
		<Setter Property="IsTabStop" Value="False" />
		<Setter Property="TextBoxStyle" Value="{StaticResource TextBoxStyle}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="sdk:AutoCompleteBox">
					<Grid Opacity="{TemplateBinding Opacity}">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="PopupStates">
								<VisualStateGroup.Transitions>
									<VisualTransition GeneratedDuration="0:0:0.1" To="PopupOpened" />
									<VisualTransition GeneratedDuration="0:0:0.2" To="PopupClosed" />
								</VisualStateGroup.Transitions>
								<VisualState x:Name="PopupOpened">
									<Storyboard>
										<DoubleAnimation To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PopupBorder" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="PopupClosed">
									<Storyboard>
										<DoubleAnimation To="0.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PopupBorder" />
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="ValidationStates">
								<VisualState x:Name="Valid" />
								<VisualState x:Name="InvalidUnfocused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="InvalidFocused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" Storyboard.TargetName="validationTooltip">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<system:Boolean>True</system:Boolean>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<TextBox x:Name="Text" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Foreground="{TemplateBinding Foreground}" IsTabStop="True" Margin="0" Padding="{TemplateBinding Padding}" Style="{TemplateBinding TextBoxStyle}" />
						<Border x:Name="ValidationErrorElement" BorderBrush="{StaticResource ValidationErrorElement}" BorderThickness="1" CornerRadius="1" Visibility="Collapsed">
							<ToolTipService.ToolTip>
								<ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}">
									<ToolTip.Triggers>
										<EventTrigger RoutedEvent="Canvas.Loaded">
											<BeginStoryboard>
												<Storyboard>
													<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="validationTooltip">
														<DiscreteObjectKeyFrame KeyTime="0">
															<DiscreteObjectKeyFrame.Value>
																<system:Boolean>true</system:Boolean>
															</DiscreteObjectKeyFrame.Value>
														</DiscreteObjectKeyFrame>
													</ObjectAnimationUsingKeyFrames>
												</Storyboard>
											</BeginStoryboard>
										</EventTrigger>
									</ToolTip.Triggers>
								</ToolTip>
							</ToolTipService.ToolTip>
							<Grid Background="Transparent" HorizontalAlignment="Right" Height="12" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12">
								<Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" Fill="{StaticResource ValidationErrorElement}" Margin="1,3,0,0" />
								<Path Data="M 0,0 L2,0 L 8,6 L8,8" Fill="{StaticResource LightForegroundBrush}" Margin="1,3,0,0" />
							</Grid>
						</Border>
						<Popup x:Name="Popup">
							<Grid Opacity="{TemplateBinding Opacity}">
								<Border x:Name="PopupBorder" HorizontalAlignment="Stretch" Opacity="0">
									<Border.RenderTransform>
										<TranslateTransform X="1" Y="1" />
									</Border.RenderTransform>
									<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0" HorizontalAlignment="Stretch" Opacity="1.0" Padding="0">
										<Border.RenderTransform>
											<TransformGroup>
												<TranslateTransform X="-1" Y="-1" />
											</TransformGroup>
										</Border.RenderTransform>
										<ListBox x:Name="Selector" BorderThickness="0" Background="{TemplateBinding Background}" Foreground="{TemplateBinding Foreground}" ScrollViewer.HorizontalScrollBarVisibility="Auto" ItemTemplate="{TemplateBinding ItemTemplate}" ItemContainerStyle="{TemplateBinding ItemContainerStyle}" ScrollViewer.VerticalScrollBarVisibility="Auto" />
									</Border>
								</Border>
							</Grid>
						</Popup>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

    <!--********************** Implicit Styles *********************** -->
    <Style BasedOn="{StaticResource LabelStyle}" TargetType="sdk:Label" />
    <Style BasedOn="{StaticResource TabControlStyle}" TargetType="sdk:TabControl" />
    <Style BasedOn="{StaticResource TabItemStyle}" TargetType="sdk:TabItem" />
    <Style BasedOn="{StaticResource GridSplitterStyle}" TargetType="sdk:GridSplitter" />
    <Style BasedOn="{StaticResource AutoCompleteBoxStyle}" TargetType="sdk:AutoCompleteBox" />
    
</ResourceDictionary>